<?php


require_once '/data/wwwroot/package/vendor/autoload.php';
use PhpAmqpLib\Connection\AMQPStreamConnection;
use PhpAmqpLib\Message\AMQPMessage;
ini_set('memory_limit', '2048M');



$sleep = $argv[1] ?? 0;
$severities = array_slice($argv, 2);

try {
//    \core\CSimpleRabbitMQ::getInstance()->connect()->consume($sleep);
//    \core\CRabbitMQFanout::getInstance()->connect()->consume($sleep, $severities);
    \core\CRabbitMQTopic::getInstance()->connect()->consume($sleep, $severities);

    echo " [*] Waiting for messages. To exit press CTRL+C", PHP_EOL;




} catch (Exception $e) {
    // Channel was canceled
    echo " [x] Received error : ", $e->getMessage(), PHP_EOL;
}
